<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title></title>
</head>

<body>
    <script>
        function getSum(n, m) {
            var sum = 0;
            for (var i = n; i <= m; i++) {
                sum += i;
            }
            console.log(n + '-' + m + '之间的数相加为：' + sum);
        }
        getSum(5, 10);
        getSum(100, 1000);
    </script>

</body>

</html>